Skip to content

Latest commit

 

History

History
75 lines (46 loc) · 1.76 KB

File metadata and controls

75 lines (46 loc) · 1.76 KB

GPIO output - Lamp LED

This demo is based on the output mode of GPIO.

Hardware Connection

This demo is based on BL706_IOT and the connection method is as follows

   GPIO function         GPIO pin
----------------------------------
    D0      <-->     GPIO22
    D1      <-->     GPIO29
    D2      <-->     GPIO30
    D3      <-->     GPIO31

Software Implementation

  • See examples/gpio/gpio_blink for the software code
gpio_set_mode(GPIO_PIN_22, GPIO_OUTPUT_PP_MODE);
gpio_set_mode(GPIO_PIN_29, GPIO_OUTPUT_PP_MODE);
gpio_set_mode(GPIO_PIN_30, GPIO_OUTPUT_PP_MODE);
gpio_set_mode(GPIO_PIN_31, GPIO_OUTPUT_PP_MODE);
  • Use the above code to configure GPIO22 GPIO29 GPIO30 GPIO31 to output pull-up mode.
gpio_write(GPIO_PIN_22, 0);
  • Use the above code to modify the output level value.

Compile and Program

 $ cd <sdk_path>/bl_mcu_sdk
 $ make BOARD=bl706_iot APP=gpio_blink

Experimental Phenomena

Video display: